﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TimeManagementSystem
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            /*var rc = new RC4(System.Configuration.ConfigurationManager.AppSettings.Get("mainKey"));
            Response.Write(rc.Encode("admin"));*/
        }

        protected void loginBtn_OnClick(object sender, EventArgs e)
        {
            string sessionId;
            if ((sessionId = Global.inputValid.AuthorizeUser(loginBox.Text, passwordBox.Text,
                        Request.Cookies["ASP.NET_SessionId"].Value)) == null)
            {
                sessionId = "empty";
            }
            Response.Cookies["sessionId"].Value = sessionId;
            Response.Redirect("/Default.aspx");
        }
    }
}